
<script>
import {getMiniWechatImg, judgeQrCode} from "@/api/ums/member";
import {mapGetters} from "vuex";

export default {
  computed: {
    ...mapGetters(['roles'])
  },
  data() {
    return {
      open: false,
      miniImg: null,
      qrCode: null
    }
  },
  methods: {
    // initMiniWechatImg() {
    //   getMiniWechatImg({scene: 2}).then(res => {
    //     this.miniImg = res.data
    //   })
    // },
    show() {
      //如果是管理员的账号进入，直接过滤
      if (this.roles.includes("admin")) {
        this.$emit("confirmOk", true)
        return
      }
      // this.initMiniWechatImg()
      this.open = true
    },
    async asyncOk(){
      // const res = await judgeQrCode({code: this.qrCode}).then(res=>{
      //   return res.data
      // })
      // if (res) {
      //   this.open = false
      // } else {
      //   this.$message.error('验证码错误')
      // }
      this.$emit("confirmOk", res)
    }
  }
}
</script>

<style lang="stylus">
.qr-code
  min-width 150px
  height 150px
  margin 20px 20px 20px 0
.left-input
  .el-input__inner
    border-radius 4px 0 0 4px !important
.right-btn
  border-radius 0 4px 4px 0 !important
</style>
